<!DOCTYPE html>
<html lang="fr">
<head>
	<meta charset="utf-8">
	<title>BattleFields SpaceFighter</title>
	<meta name="description" content="">
	<link href="css/global.css" type="text/css" rel="stylesheet" />
	<link href="css/form.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php
    require_once("config/db.php");
    include("model/Login.php");
    if(!empty($_POST["login1"]) && !empty($_POST["login2"])){
        $login = new Login();
        $login->connect($_POST["login1"], $_POST["login2"]);
?>
	<form id="game_form" class="forms" >
		<fieldset>
			<label>Partie : </label>
			<?php  $login->existGame($login->id1, $login->id2); ?>

		</fieldset>
	</form>

<?php
    }
    else {
?>
	<div id="login_formulaire">
		<form id="login_form" class="forms" method="POST">
			<fieldset>
				<label for="login">Login P1</label>
				<input type="text" name="login1" id="login1" /><br />
				<label for="login">Login P2</label>
				<input type="text" name="login2" id="login2" /><br />
				<input type="submit" value="Se Connecter !" /><br />
			</fieldset>
		</form>
	</div>
<?php
	}
?>
</body>
</html>